package day1;


import java.util.*;

public class Arr2Test   {

    public static void main(String[] args) {
        List list=new ArrayList();
        list.add(new Pet("小花花",100,55));
        list.add(new Pet("大黄",66,65));
        list.add(new Pet("旺财",55,66));
        list.add(new Pet("哮天犬",44,100));
        for(Object o:list)
        {
            Pet pet=(Pet)o;
            System.out.println(pet);
        }
        Pet p=new Pet("旺财",55,66);

        // System.out.println(list);
        boolean in=list.contains(p);
        System.out.println("再？"+in);

        int pos=list.indexOf(p);
        System.out.println(pos);
    }


}
